//Authors: 
//Andrew Hall
//Tyler Wozniak

#include <string>
#include <iostream>
using namespace std;
#include "Vector3D.h"
#include "Quaternion.h";
#include <math.h>

int main()
{
	double tempValues[] = {5.5, 4.4, 3.3};
	Vector3D* vector1 = new Vector3D(tempValues);

	tempValues[0] = 8.8;
	tempValues[1] = 7.7;
	tempValues[2] = 6.6;

	Vector3D* vector2 = new Vector3D(tempValues);

	cout << "Vector 1: " << endl;
	cout << *vector1 << endl << endl;
	cout << "Vector 2: " << endl;
	cout << *vector2 << endl << endl;

	Vector3D* vector3 = new Vector3D();
	*vector3 = *vector1 + *vector2;

	cout << "Vector 3- an addition of vectors 1 and 2: " << endl;
	cout << *vector3 << endl << endl;

	*vector3 = *vector3 - *vector2;

	cout << "Vector 3 after subtracting vector 2: " << endl;
	cout << *vector3 << endl << endl;

	Vector3D* vector4 = new Vector3D();
	*vector4 = *vector1 * *vector2;

	cout << "Vector 4- vectors 1 and 2 multiplied using dot product: " << endl;
	cout << *vector4 << endl << endl;

	cout << "Index 3 of vector 4 (the z value): " << endl;
	cout << (*vector4)[2] << endl << endl;

	cout << "Vector 1 cross Vector 2: " << endl;
	cout << (*vector1 % *vector2) << endl << endl;

	tempValues[0] = 5;
	tempValues[1] = 5;
	tempValues[2] = 5;

	Vector3D* vector5 = new Vector3D(tempValues);

	cout << "Vector 5: " << endl;
	cout << *vector5 << endl << endl;

	*vector5 = (*vector5).matrixRotate((*vector5).getX(), (*vector5).getY(), (*vector5).getZ(), 30);

	cout << "Vector1 rotated 30 degrees: " << endl;
	cout << *vector5 << endl << endl;

	Quaternion* q1 = new Quaternion(*vector1);

	cout << "Quaternion q1: made from vector 1: " << endl;
	cout << *q1 << endl << endl;

	Quaternion* q2 = new Quaternion(1.1, 2.2, 3.3, 4);

	cout << "Quaternion q2: " << endl;
	cout << *q2 << endl << endl;

	Quaternion* q3 = new Quaternion(*q2);

	cout << "q3: copy of q2" << endl;
	cout << *q3 << endl << endl;

	*q3 = *q2 + *q3;

	cout << "q3 given value q2 + q3" << endl;
	cout << *q3 << endl << endl;

	*q3 = *q3-*q2;

	cout << "and subtracted again" << endl;
	cout << *q3 << endl << endl;

	Quaternion* q4 = new Quaternion(4,5,6,7);

	cout << "Quaternion q4: " << endl;
	cout << *q4 << endl << endl;

	*q4 = *q4 * *q4;

	cout << "q4 dot q4:" << endl;
	cout << *q4 << endl << endl;

	*q4 = *q4 * 0.3;

	cout << "q4 multiplied by scalar 0.3: " << endl;
	cout << *q4 << endl << endl;

	*q4 = -*q4;

	cout << "q4 negated: " << endl;
	cout << *q4 << endl << endl;

	delete vector1;
	delete vector2;
	delete vector3;
	delete vector4;
	delete vector5;
	delete q1;
	delete q2;
	delete q3;
	delete q4;

	//double d1[3] = {5,3,7};
 //	Vector3D* v1 = new Vector3D();
	//Vector3D* v2 = new Vector3D(d1);
	//Vector3D* v3 = new Vector3D(*v2);
	//Vector3D* v4 = v3;

	//cout << "\nTesting Constructors & Copying" << endl;
	//cout << "v1: " << *v1 << endl;
	//cout << "v2: " << *v2 << endl;
	//cout << "v3: " << *v3 << endl;
	//cout << "v4: " << *v4 << endl;
	//delete v1;

	//double d2[3] = {1,2,3};
	//Vector3D* v5 = new Vector3D(d2);

	//cout << "\nTesting Arithmetic, Dot Product, & Cross Product" << endl;
	//cout << "v5: " << *v5 << endl;
	//*v2 = *v5 + *v2;
	//cout << "v2 + v5 = " << *v2 << endl;
	//*v3 = *v3 - *v5;
	//cout << "v3 - v5 = " << *v3 << endl;
	//*v4 = *v4 * *v5;
	//cout << "v4 dot v5 = " << *v4 << endl;
	//*v5 = *v5 % *v2;
	//cout << "v5 cross v2 = " << *v5 << endl;

	//cout << "\nTesting Index & Magnitude" << endl;
	//cout << "Mag of v2: " << double(*v2) << endl;
	//cout << "Mag of v3: " << double(*v3) << endl;
	//cout << "Mag of v4: " << double(*v4) << endl;
	//cout << "Mag of v5: " << double(*v5) << endl;

	//cout << "V2[0]: " << (*v2)[0] << endl;
	//cout << "V2[1]: " << (*v2)[1] << endl;
	//cout << "V2[2]: " << (*v2)[2] << endl;

	system("pause");
}